#include "Mutex.h"

Mutex::Mutex(){
	
	pthread_mutex_init(&mutex,0);	
}

int Mutex::lock(){

	return pthread_mutex_lock(&mutex);	
}

int Mutex::unlock(){

	return pthread_mutex_unlock(&mutex);	
}

Mutex::~Mutex(){}

Locking::Locking(Mutex& m):mutex(m){

		mutex.lock();
}

Locking::~Locking(){
		mutex.unlock();
}
